package com.wjerp.tplus.server.common.constant;

/**
 * 权限定义模块
 * @author lishuailei
 */
public enum UserType {

	//系统用户
    ADMIN_USER(1,"系统用户"),
    COMPANY_USER(3,"公司用户"),
    MERCHANT_USER(2,"注册用户"),
    ;

	private Integer code;
    private String key;


    private UserType(Integer code,String key) {
        this.code = code;
        this.key = key;
    }


    public String getKey() {
        return key;
    }

    public Integer getCode() {
        return code;
    }

    public static UserType resolve(Integer code) {
        for (UserType item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
